package com.hutao.medical.pojo.model;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hutao.medical.common.util.StringUtil;

/**
 * 临时医嘱记录
 * @author lyh
 *
 */
public class HospitalVisitDoctorAdviceTemporaryRecord {

	/**
	 * 患者
	 */
	private String patientName;
	
	/**
	 * 科室名称
	 */
	private String deptName;
	
	/**
	 * 床号名称
	 */
	private String bedName;
	
	/**
	 * ID号
	 */
	private String patientId;
	
	/**
	 * 病案号
	 */
	private String mrId;
	
	/**
	 * 临时医嘱项集合
	 */
	private List<HospitalVisitDoctorAdviceTemporaryItem> doctorAdviceTemporaryItems = new ArrayList<HospitalVisitDoctorAdviceTemporaryItem>();

	@JsonIgnore
	public void clearEmpty(){
		for (int i = this.doctorAdviceTemporaryItems.size()-1; i >=0; i--) {
			HospitalVisitDoctorAdviceTemporaryItem doctorAdviceTemporaryItem = this.doctorAdviceTemporaryItems.get(i);
			if(doctorAdviceTemporaryItem.isEmpty()){
				this.doctorAdviceTemporaryItems.remove(i);
			}
		}
	}
	
	@JsonIgnore
    public boolean isEmpty(){
    	if(this.getPatientName() == null && this.getBedName() == null
    			&& this.getMrId() == null){
    		return true;
    	}
    	return false;
    }
	
	public String getPatientName() {
		return StringUtil.meaningStr(patientName);
	}

	public void setPatientName(String patientName) {
		this.patientName = patientName;
	}

	public String getDeptName() {
		return StringUtil.meaningStr(deptName);
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public String getBedName() {
		return StringUtil.meaningStr(bedName);
	}

	public void setBedName(String bedName) {
		this.bedName = bedName;
	}

	public String getPatientId() {
		return StringUtil.meaningStr(patientId);
	}

	public void setPatientId(String patientId) {
		this.patientId = patientId;
	}

	public String getMrId() {
		return StringUtil.meaningStr(mrId);
	}

	public void setMrId(String mrId) {
		this.mrId = mrId;
	}

	public List<HospitalVisitDoctorAdviceTemporaryItem> getDoctorAdviceTemporaryItems() {
		return doctorAdviceTemporaryItems;
	}

	public void setDoctorAdviceTemporaryItems(
			List<HospitalVisitDoctorAdviceTemporaryItem> doctorAdviceTemporaryItems) {
		this.doctorAdviceTemporaryItems = doctorAdviceTemporaryItems;
	}

	
	
	
	
}
